package school.valon.persistence.pojo;

import java.io.Serializable;

import javax.persistence.*;

/**
 * The primary key class for the expense_payment database table.
 * 
 */
@Embeddable
public class ExpensePaymentPK implements Serializable {

	private static final long serialVersionUID = -2193541068923381715L;

	@Column(name="payment_id", insertable=false, updatable=false)
	private Integer paymentId;

	@Column(name="expense_category_id", insertable=false, updatable=false)
	private Integer expenseCategoryId;

	public ExpensePaymentPK() {
	}
	public int getPaymentId() {
		return this.paymentId;
	}
	public void setPaymentId(int paymentId) {
		this.paymentId = paymentId;
	}
	public int getExpenseCategoryId() {
		return this.expenseCategoryId;
	}
	public void setExpenseCategoryId(int expenseCategoryId) {
		this.expenseCategoryId = expenseCategoryId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof ExpensePaymentPK)) {
			return false;
		}
		ExpensePaymentPK castOther = (ExpensePaymentPK)other;
		return 
			(this.paymentId == castOther.paymentId)
			&& (this.expenseCategoryId == castOther.expenseCategoryId)
			&& (this.paymentId != null && this.paymentId.equals(castOther.paymentId))
			&& (this.expenseCategoryId != null && this.expenseCategoryId.equals(castOther.expenseCategoryId));
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + (this.paymentId == null ? 0 : this.paymentId);
		hash = hash * prime + (this.expenseCategoryId == null ? 0 : this.expenseCategoryId);
		
		return hash;
	}
}